// lib/core/type_registry.dart
import 'package:base/main.dart';

class TypeRegistry {
  static final Map<Type, void Function()> _deleters = {};

  // 显式注册类型删除器
  static void registerDeleter<T>() {
    Log.w('注册: ${T.toString()}');
    _deleters[T] = () {
      Get.delete<T>();
    };
  }

  // 动态删除实例
  static void delete(Type type) {
    _deleters[type]?.call();
  }
}
